home *** CD-ROM | disk | FTP | other *** search
/ Digital Pose Collection / Digital Pose Collection.iso / mac / Modules / CALENDER / CALENDER.dxr / 00001.ls next >
Encoding:
Text File  |  1996-05-28  |  2.3 KB  |  144 lines

  1. global gv, gh, gct, gsp, gpre, gmonth, nowpict, rwobj, gmsize, dobj, call
  2.  
  3. on startMovie
  4.   cursor(200)
  5.   set call to [7, 8, 9, 7, 8, 9, 7, 8, 9, 7, 8, 9]
  6.   openXLib("xGetDate")
  7.   set dobj to xgetdate(mnew)
  8.   set gv to the mouseV
  9.   set gh to the mouseH
  10.   set the exitLock to 1
  11.   if yearcheck() = 1 then
  12.     repeat with i = 1 to 4
  13.       puppetSprite(i, 0)
  14.     end repeat
  15.     go("ready")
  16.   else
  17.     dosetup()
  18.   end if
  19. end
  20.  
  21. on dosetup
  22.   repeat with i = 1 to 4
  23.     puppetSprite(i, 1)
  24.     set the stretch of sprite i to 0
  25.   end repeat
  26.   setsprite()
  27. end
  28.  
  29. on yearcheck
  30.   set ret to 0
  31.   if (getyear() < "1995") or (getyear() > "1999") then
  32.     set ret to 1
  33.   end if
  34.   return ret
  35. end
  36.  
  37. on setsprite
  38.   yearcheck()
  39.   set gmonth to value(getmonth())
  40.   set myyear to value(getyear())
  41.   set nowpict to ((myyear - 1995) * 20) + gmonth
  42.   set calnum to getAt(call, gmonth)
  43.   if (gmonth mod 2) = 0 then
  44.     set nowsp to 2
  45.   else
  46.     set nowsp to 3
  47.   end if
  48.   set the castNum of sprite 4 to the number of member nowpict
  49.   set the castNum of sprite nowsp to the number of member calnum
  50.   updateStage()
  51. end
  52.  
  53. on myaction
  54.   mysaver(1)
  55.   if yearcheck() = 0 then
  56.     setsprite()
  57.   end if
  58.   updateStage()
  59. end
  60.  
  61. on mysaver x
  62.   if (gv <> the mouseV) or (gh <> the mouseH) then
  63.     dosaver(x)
  64.   end if
  65.   when keyDown then doSaver x
  66.   when mouseDown then doSaver x
  67. end
  68.  
  69. on dosaver x
  70.   repeat with i = 1 to 4
  71.     set the castNum of sprite i to the number of member "dummy"
  72.   end repeat
  73.   updateStage()
  74.   if objectp(dobj) then
  75.     dobj(mdispose)
  76.     closeXLib("xgetDate")
  77.   end if
  78.   quit()
  79. end
  80.  
  81. on areuready
  82.   mysaver(2)
  83.   if yearcheck() = 0 then
  84.     go(the frame + 1)
  85.   end if
  86. end
  87.  
  88. on getdate
  89.   set ret to EMPTY
  90.   if objectp(dobj) then
  91.     set ret to dobj(mgetdate)
  92.   end if
  93.   return ret
  94. end
  95.  
  96. on getyear
  97.   if objectp(dobj) then
  98.     set ret to dobj(mgetyear)
  99.   end if
  100.   return ret
  101. end
  102.  
  103. on getmonth
  104.   if objectp(dobj) then
  105.     set ret to dobj(mgetmonth)
  106.   end if
  107.   return ret
  108. end
  109.  
  110. on getday
  111.   if objectp(dobj) then
  112.     set ret to dobj(mgetday)
  113.   end if
  114.   return ret
  115. end
  116.  
  117. on gettime
  118.   if objectp(dobj) then
  119.     set ret to dobj(mgettime)
  120.   end if
  121.   return ret
  122. end
  123.  
  124. on gethour
  125.   if objectp(dobj) then
  126.     set ret to dobj(mgethour)
  127.   end if
  128.   return ret
  129. end
  130.  
  131. on getmin
  132.   if objectp(dobj) then
  133.     set ret to dobj(mgetmin)
  134.   end if
  135.   return ret
  136. end
  137.  
  138. on getsec
  139.   if objectp(dobj) then
  140.     set ret to dobj(mgetsec)
  141.   end if
  142.   return ret
  143. end
  144.